! function() {
	var e = {
		IS_DEBUG: 0,
		PAGE_SIZE: 20,
		PAGE: 1,
		M_API: "http://m.fruitday.com/",
		WAP_API: "https://wap.fruitday.com/",
		HOST_API: location.protocol + "//" + location.host + "/",
		HOST_IMAGE: location.protocol + "//" + location.host + "/",
		SHARE_HOST: location.protocol + "//" + location.host,
		DEF_IMG_URL: "../images/common/default.png",
		RATIO_OF_ADSPIC: 75 / 106,
		RATIO_OF_MAINPIC: 375 / 410,
		RATIO_OF_DETAILPIC: 1,
		RATIO_OF_MAINCOVER: 640 / 137,
		ACTIVITY_BANNER: 1.875,
		SMS_DURATION: 120,
		NO_GEO_LOCATION: 0,
		LOCALHOSTS: ["127.0.0.1", "", "localhost", "test.m.fruitday.com", "test.wap.fruitday.com"],
		SHARE_HOSTS: [location.protocol + "//" + location.host],
		BAIDU_ID: "",
		VERSION: "1.0.0"
	};
	if(e.IS_DEBUG) {
		e.NO_GEO_LOCATION = 1;
		for(var t = 0, n = e.LOCALHOSTS.length; t < n; t++) {
			if("staging.m.fruitday.com" == location.hostname || "stagingwap.m.fruitday.com" == location.hostname || "m.fruitday.com" == location.hostname) {
				e.HOST_API = "", alert("请关闭开发模式");
				break
			}
			if(e.LOCALHOSTS[t] == location.hostname) {
				e.HOST_API = "https://stagingwap.fruitday.com/";
				break
			}
		}
		e.BAIDU_ID = ""
	}
	window.config = e
}(),
function() {
	function e(e) {
		this.options = e || {}, this.timeout = 15e3, this.cache = !0, this.defaultListTmpl = "fruitday-list-tmpl", this.defaultListEle = "#fruitday-list", this.defaultDetailTmpl = "fruitday-detail-tmpl", this.defaultDetailEle = "#fruitday-detail", this.isLoading = !1, this.hasNext = !0, this.queue = {}, this.tempPage = {}, this.onEnd = function() {}
	}

	function t(e, t, o, a) {
		if($("#" + t).length > 0 && o) {
			"undefined" != typeof o.length && (o = {
				list: o
			});
			var i = n(t, o);
			a ? $(e).append(i) : $(e).html(i)
		}
	}

	function n(e, t) {
		return template.render(e, t)
	}

	function o(e, t, n) {
		log("[" + e + "] " + t + ":" + n, 2)
	}

	function a(e) {
		var t = !0;
		for(var n in e) {
			t = !1;
			break
		}
		return t
	}

	function i(e, t) {
		var n, o = [];
		for(var a in e) o.push(e[a]), t == a && (n = e[a]);
		return 0 == o.length ? e[t] = 1 : n ? n : (o = o.sort(), e[t] = o[o.length - 1] + 1)
	}

	function r(e, t) {
		if(e) {
			var n = {
				current_page: e.current,
				per_page: e.size,
				total: e.count
			};
			n.current_page = parseInt(n.current_page), n.total = parseInt(n.total), n.per_page = parseInt(n.per_page), n.total = Math.ceil(n.total / n.per_page), n.prev_page = 1 == n.current_page ? 1 : n.current_page - 1, n.next_page = n.current_page == n.total ? n.current_page : n.current_page + 1;
			var o = n.current_page - 2,
				a = n.current_page + 2;
			n.total <= 5 ? (o = 1, a = n.total) : (o < 1 && (o = 1, a = o + 4), a > n.total && (a = n.total, o = n.total - 4));
			var i = "";
			i += "<dl><dt" + (1 == n.prev_page ? ' class="disabled"' : "") + '><a href="#' + n.prev_page + '"><img src="images/arrow_left.gif"></a></dt><dd>';
			for(var r = o; r <= a; r++) i += '<a href="#' + r + '"' + (n.current_page == r ? ' class="active"' : "") + ">" + r + "</a>";
			i += '</dd><dt class="ari' + (n.next_page >= n.total ? " disabled" : "") + '"><a href="#' + n.next_page + '"><img src="images/arrow_left.gif"></a></dt></dl>', $(t).html(i).show()
		}
	}

	function s(e, t) {
		e = e || {};
		for(var n in t) e[n] = "undefined" == typeof e[n] ? t[n] : e[n]
	}

	function c(e) {
		return !!e && "object" == typeof e && void 0 != typeof e.length
	}! function() {
		if(location.host.indexOf("m.fruitday.com") > -1) var e = "../content/html/toast.html";
		else var e = config.HOST_API + "content/html/toast.html";
		$.ajax({
			url: e,
			async: !1
		}).done(function(e) {
			$("body").append(e)
		})
	}();
	var l = '<div class="nodata">暂无数据。</div>',
		d = '<div class="nodata">没有更多数据。</div>',
		u = '<div class="nodata">服务器异常。</div>',
		p = '<div class="nodata">数据错误。</div>',
		h = $("#fruitday-loading");
	e.prototype._init = function() {
		this.spinnings;
		return this
	}, e.prototype.paging = function(e, t, n) {
		var o = this,
			a = 1 == e.data.page,
			c = {
				renderFor: this.defaultListTmpl,
				renderEle: this.defaultListEle,
				pagingDom: ".pagination",
				pagingMode: "next",
				timeKey: "createAt",
				key: "data",
				showLoading: !0,
				logtype: "paging"
			};
		if(s(e, c), "number" == e.pagingMode) $(e.renderEle).html("正在加载中..."), $(e.pagingDom).hide();
		else if("next" == e.pagingMode) {
			var h = i(o.tempPage, e.url);
			h = 1;
			var f = $("#np-" + h),
				g = '<div id="np-' + h + '" class="nextpage">正在加载中...</div>';
			0 == f.length && ($(e.renderEle).after(g), f = $("#np-" + h)), f.html("正在加载中...").addClass("disabled"), a && ($(e.renderEle).html(""), $(e.emptyEle).hide())
		}
		o.ajaxSend(e, function(n, i, s) {
			var c = n[e.key];
			return "-1" == e.key && (c = n), o.isSusPagingData(c) ? ("number" == e.pagingMode ? (c && 0 != c.length ? o.render(e.renderEle, e.renderFor, c) : a && $(e.renderEle).html(l), r(n.pageInfo, e.pagingDom)) : "next" == e.pagingMode && (0 == c.length ? a ? (f.hide(), $(e.emptyEle).length > 0 ? $(e.emptyEle).show() : $(e.renderEle).html(l)) : f.html(d) : (o.hasNext = c.length == e.data.limit, f.show(), o.render(e.renderEle, e.renderFor, c, !a), o.hasNext ? f.html("正在加载更多").removeClass("disabled") : f.html(d))), void("function" == typeof t && t(n))) : ($(e.renderEle).html(p), void f.hide())
		}, function(t, o) {
			$(e.renderEle).html(u), f.hide(), "function" == typeof n && n(t, o)
		})
	}, e.prototype.detail = function(e, n, o) {
		var a = this,
			i = {
				renderFor: this.defaultDetailTmpl,
				renderEle: this.defaultDetailEle,
				key: "body",
				showLoading: !0,
				logtype: "detail"
			};
		s(e, i), e.showLoading && $(e.renderEle).html('<div class="loading">加载中...</div>'), a.ajaxSend(e, function(o, a, i) {
			if(log("ajaxSend end " + (new Date).getTime()), o.error) return void $(e.renderEle).html(o.error);
			var r = o[e.key] || {};
			r && t(e.renderEle, e.renderFor, r), "function" == typeof n && n(o)
		}, o)
	}, e.prototype.submit = function(e, t, n) {
		var o, a, i = this,
			r = !!e.data.length,
			c = {
				type: "POST",
				showLoading: !0,
				logtype: "submit"
			};
		s(e, c), r ? (o = e.data.serializeArray(), a = e.data.find('[type="submit"]'), a.attr("disabled", !0)) : o = e.data, e.data = o, i.ajaxSend(e, function(e, n, o) {
			r && a.removeAttr("disabled"), "function" == typeof t && t(e)
		}, function(e, t, o) {
			r && a.removeAttr("disabled"), "function" == typeof n && n(e, t, o)
		})
	}, e.prototype.custom = function(e, t, n) {
		var o = this,
			a = {
				logtype: "custom"
			};
		s(e, a), o.ajaxSend(e, t, n)
	}, e.prototype.ajaxSend = function(e, t, n) {
		var i = this;
		i.isLoading = !0, i.queue[e.url] = !0, e.showLoading && h.show(), e = e || {};
		var r = Storage.get("USERTOKEN");
		r && (header.UserToken = r), void 0 == typeof e.contentType && (e.contentType = "application/json"), void 0 == typeof e.processData && (e.processData = !0), $.ajax({
			url: e.url,
			data: e.data,
			type: e.type || "GET",
			dataType: "json",
			timeout: i.timeout,
			cache: i.cache,
			contentType: e.contentType,
			processData: e.processData,
			username: "",
			password: "",
			success: function(o, r, s) {
				Tools.alert("success data:" + JSON.stringify(o).substring(0, 300)), i.isLoading = !1, delete i.queue[e.url];
				var c = parseInt(o.code);
				return 400 == c && (Cookie.remove("connect_id"), Storage.remove("connect_id"), !Tools.isFruitdayAppBrowser() && location.host.indexOf("wap.fruitday.com") > -1) ? void(location.href = "/me/login.html") : ("function" == typeof t && 200 == c ? t(o) : "function" == typeof n && n(r, o), void(a(i.queue) && "function" == typeof i.onEnd && i.onEnd.call(this)))
			},
			error: function(t, r, s) {
				Tools.alert("error data: " + JSON.stringify(t.response)), o(e.logtype, r, e.url), "function" == typeof n && n(r, {}), a(i.queue) && "function" == typeof i.onEnd && i.onEnd.call(this)
			},
			complete: function(t, n) {
				e.showLoading && setTimeout(function() {
					h.hide()
				}, 100), $(e.renderEle).show()
			}
		})
	}, e.prototype.render = t, e.prototype.logged = o, e.prototype.isSusPagingData = c, window.Ajax = new e
}(),
function() {
	var e = {
		get: function(e) {
			var t = "(?:;)?" + e + "=([^;]*);?",
				n = new RegExp(t);
			if(!n.test(document.cookie)) return null;
			try {
				return unescape(RegExp.$1)
			} catch(o) {
				return null
			}
		},
		_set: function(e, t, n, o, a, i) {
			var r = null;
			r = "number" == typeof n && "number" == typeof o && "number" == typeof a && "number" == typeof i ? 0 == n && 0 == o && 0 == a && 0 == i ? null : this.getExpDate(n, o, a, i) : n || this.getExpDate(7, 0, 0, 0), document.cookie = e + "=" + escape(t) + (null == r ? "" : ";expires=" + r) + "; path=/; domain=.fruitday.com"
		},
		set: function(e, t, n) {
			this._set(e, t, n, 0, 0, 0)
		},
		remove: function(e) {
			this.set(e, "", -1)
		},
		getExpDate: function(e, t, n, o) {
			var a = new Date;
			if("number" == typeof e && "number" == typeof t && "number" == typeof n && "number" == typeof o) return a.setDate(a.getDate() + parseInt(e)), a.setHours(a.getHours() + parseInt(t)), a.setMinutes(a.getMinutes() + parseInt(n)), a.setSeconds(a.getSeconds() + parseInt(o)), a.toGMTString()
		}
	};
	window.Cookie = e
}(),
function() {
	var e = {
		sep: ":",
		loadURL: function(e, t) {
			var n, o = e + this.sep + t;
			return n = document.createElement("iframe"), n.setAttribute("src", o), n.setAttribute("style", "display:none;"), n.setAttribute("height", "0px"), n.setAttribute("width", "0px"), n.setAttribute("frameborder", "0"), document.body.appendChild(n), n.parentNode.removeChild(n), n = null, o
		}
	};
	e.noticeIsLogout = function() {
		return this.loadURL("logout", "1")
	}, e.toOrder = function(e) {
		return this.loadURL("order", e)
	}, e.toPay = function(e) {
		return this.loadURL("pay", e)
	}, e.toCategory = function(e) {
		return this.loadURL("category", e || 1)
	}, e.toHome = function(e) {
		return this.loadURL("home", e || 1)
	}, e.toGroup = function(e) {
		return this.loadURL("group", e || 1)
	}, e.toShare = function() {
		var e = "{}";
		return this.shareData && (e = JSON.stringify(this.shareData)), this.loadURL("share", e)
	}, e.getShareData = function() {
		return this.shareData
	}, e.setHeader = function(e) {
		var t = {};
		try {
			t = JSON.parse(e), Storage.set("AppHeader", t)
		} catch(n) {}
		return t
	}, e.cancelPay = function() {
		$(".btn-pay").text("立即支付").removeClass("disabled")
	}, e.init = function(e, t) {
		e && Cookie.set("UserSN", e), t && Cookie.set("RBYAIRID", t)
	}, e.noticeCart = function(e) {
		this.loadURL("cart", e)
	}, e.toGoods = function(e) {
		return this.loadURL("goods", e)
	}, e.toBack = function() {
		return this.loadURL("back", 1)
	}, window.Jiao = e
}();
var log = function(e) {
	"undefined" != typeof console && console.log(e)
};
! function(e) {
	var t = 0,
		n = function(e) {
			var t = this;
			if("object" == typeof e)
				for(var n in e) t[n] = e[n];
			else "string" == typeof e && (t.targetPage = $(e));
			t.coverDom = t.coverDom || $("#sidebar-bg"), t.coverDom.click(function(e) {
				e.preventDefault(), t.closeSidebar()
			})
		};
	n.prototype = {
		targetPage: void 0,
		coverDom: void 0,
		beforeOpen: function() {},
		afterClose: function() {},
		openSidebar: function(n) {
			var o = $(e),
				a = o.width(),
				i = (o.height(), this.targetPage.height(), this);
			i.coverDom.show(), i.targetPage.show().css({
				width: a
			}), setTimeout(function() {
				i.targetPage.addClass("open")
			}, 100), t++, $("body").hasClass("move") || $("body").addClass("move").css({
				width: document.documentElement.clientWidth,
				height: document.documentElement.clientHeight,
				overflow: "hidden"
			}), n && n(), i.beforeOpen && i.beforeOpen()
		},
		closeSidebar: function(e) {
			var n = this;
			this.targetPage.removeClass("open"), t--, setTimeout(function() {
				n.coverDom.hide(), n.targetPage.hide(), hasOpend = !1, t <= 0 && $("body").removeClass("move").css({
					width: "auto",
					height: "auto",
					overflow: "inherit"
				}), e && e(), n.afterClose && n.afterClose()
			}, 220)
		}
	}, e.SecondPage = n
}(window),
function() {
	var e = {
		AUTH: "FLV-AUTH",
		ACCOUNT: "FLV-ACCOUNT",
		REMEMBER: "FLV-REMEMBER",
		LOGIN_HISTORY: "LH",
		AREA: "FLV-AREA",
		get: function(e, t) {
			if(this.isLocalStorage()) {
				var n = this.getStorage(t).getItem(e);
				return n && "undefined" != n ? JSON.parse(n) : void 0
			}
		},
		set: function(e, t, n) {
			this.isLocalStorage() && (t = JSON.stringify(t), this.getStorage(n).setItem(e, t))
		},
		remove: function(e, t) {
			this.isLocalStorage() && this.getStorage(t).removeItem(e)
		},
		getStorage: function(e) {
			return e ? sessionStorage : localStorage
		},
		isLocalStorage: function() {
			try {
				return window.localStorage ? (localStorage.setItem("FORTEST", 1), !0) : (log("不支持本地存储"), !1)
			} catch(e) {
				return log("本地存储已关闭"), !1
			}
		}
	};
	window.Storage = e
}(),
function() {
	String.prototype.isSpaces = function() {
		for(var e = 0; e < this.length; e += 1) {
			var t = this.charAt(e);
			if(" " != t && "\n" != t && "\t" != t && "\r" != t) return !1
		}
		return !0
	}, String.prototype.isValidMail = function() {
		return new RegExp(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/).test(this)
	}, String.prototype.isPhone = function() {
		return new RegExp(/^1\d{10}?$/).test(this)
	}, String.prototype.isEmpty = function() {
		return /^\s*$/.test(this)
	}, String.prototype.isValidPwd = function() {
		return new RegExp(/^([_]|[a-zA-Z0-9@]){6,16}$/).test(this)
	}, String.prototype.isPostCode = function() {
		return new RegExp(/^\d{6}?$/).test(this)
	}
}(),
function() {
	"function" != typeof Object.assign && (Object.assign = function(e) {
		"use strict";
		if(null == e) throw new TypeError("Cannot convert undefined or null to object");
		e = Object(e);
		for(var t = 1; t < arguments.length; t++) {
			var n = arguments[t];
			if(null != n)
				for(var o in n) Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o])
		}
		return e
	})
}(),
function(e) {
	e && (e.openTag = "<!--[", e.closeTag = "]-->", e.helper("$absImg", function(e, t) {
		return Tools.absImg(e, t)
	}), e.helper("$formatDate", function(e, t, n) {
		return Tools.formatDate(e, t, n || "--")
	}), e.helper("$encodeUrl", function(e) {
		return encodeURIComponent(e)
	}), e.helper("$decodeUrl", function(e) {
		return decodeURIComponent(e)
	}), e.helper("$formatCurrency", function(e, t, n) {
		return Tools.formatCurrency(e, t, n)
	}), e.helper("$sliceCurrency", function(e, t) {
		return Tools.sliceCurrency(e, t)
	}), e.helper("$convertRN", function(e) {
		return e ? e.replace(/\r\n/gi, "<br/>") : "--"
	}), e.helper("$addClassByIdx", function(e, t, n) {
		if(e == t) return n || ""
	}), e.helper("$ellipsis", function(e, t) {
		var n = e.replace(/[^\x00-\xff]/g, "__").length;
		return n / 2 > t ? e.substring(0, t) + "..." : e
	}), e.helper("$getDateFromStr", function(e) {
		if(e && 0 != e.length) {
			var t = e.length > 10 ? 10 : e.length;
			return e.substring(0, t)
		}
	}), e.helper("$addClassByCondition", function(e, t, n) {
		return e ? t || "" : n || ""
	}), e.helper("$getOrderStatus", function(e, t) {
		return "detail" == t ? config.ORDER_DETAIL_STATUS[e] || "--" : "neworder" == t ? config.NEW_ORDER_STATUS[e] || "--" : config.ORDER_STATUS[e] || "--"
	}), e.helper("$getOrderFlowStatus", function(e) {
		return config.ORDERFLOW_STATUS[e] || e
	}), e.helper("$getOrderFlowTel", function(e) {
		var t = /\d{11}/,
			n = e.match(t);
		return n && n.length > 0 ? e.replace(t, '<a href="tel:' + n[0] + '">' + n[0] + "</a>") : e
	}), e.helper("$addClassForGoods", function(e, t, n) {
		return !e || isNaN(e.limitNum) || isNaN(e.store) || isNaN(e.quantity) ? "" : (e.limitNum = parseInt(e.limitNum), e.store = parseInt(e.store), e.quantity = parseInt(e.quantity), 1 == e.isDeals ? t || "" : n || "")
	}), e.helper("$getCountDown", function(e, t, n, o) {
		return "object" == typeof e ? Tools.getRunTime(e.serverTime, e.endTime, e.isPre, e.showStyle) : Tools.getRunTime(e, t, n, o)
	}), e.helper("$absWechatIcon", function(e) {
		if(!e || 0 != e.indexOf("http://")) return "../content/images/common/headicon.png";
		var t = e.split("/");
		return "0" == t[t.length - 1] && (t[t.length - 1] = "96"), t.join("/")
	}), e.helper("$getQueryValue", function(e) {
		return Tools.getQueryValue(e)
	}), e.helper("$isShuAppBrowser", function() {
		return Tools.isShuAppBrowser()
	}), e.helper("$isWeChatBrowser", function() {
		return Tools.isWeChatBrowser()
	}), e.helper("$replaceHost", function(e) {
		if(!e || !config.REPLACE_HOST || 2 != config.REPLACE_HOST.length || !Tools.isShuAppBrowser()) return e;
		var t = new RegExp(config.REPLACE_HOST[0], "g");
		return e.replace(t, config.REPLACE_HOST[1])
	}), e.helper("$hostApi", function() {
		return config.HOST_API
	}), e.helper("$isFloat", function(e) {
		var t = e.toString().indexOf(".");
		return t != -1
	}), e.helper("$config", function() {
		return Storage.get("config", 1).deliver_config
	}))
}(window.template),
function() {
	function prevent(e) {
		e.preventDefault()
	}

	function format(e, t) {
		var n = e,
			o = {
				"M+": n.getMonth() + 1,
				"d+": n.getDate(),
				"h+": n.getHours(),
				"m+": n.getMinutes(),
				"s+": n.getSeconds(),
				"q+": Math.floor((n.getMonth() + 3) / 3),
				S: n.getMilliseconds()
			};
		/(y+)/.test(t) && (t = t.replace(RegExp.$1, (n.getFullYear() + "").substr(4 - RegExp.$1.length)));
		for(var a in o) new RegExp("(" + a + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? o[a] : ("00" + o[a]).substr(("" + o[a]).length)));
		return t
	}
	var that = this,
		preventDefault, panel, panelBg, delay, count = 0,
		toastPanel, temp, TipPanel = function(e, t) {
			var n = this;
			n.panel = e || $("#fruitday-panel"), n.panelBg = panelBg || $("#fruitday-panel-bg"), n.dialogContent = n.panel.find(".dialog-content"), n.panelContent = n.panel.find(".panel-content"), n.panelTitle = n.panel.find(".panel-title"), n.panelTips = n.panel.find(".panel-tips"), n.panelButtons = n.panel.find(".panel-buttons"), n.btnOk = n.panel.find(".btn-primary"), n.btnCancel = n.panel.find(".btn-default"), n.panelText = n.panel.find(".panel-text"), n.panelTick = n.panel.find(".panel-tick"), n.panelInput = n.panel.find(".panel-input"), n.options = {
				type: "error",
				tick: 0,
				okText: "确定",
				cancelText: "取消",
				showTitle: !1,
				showTips: !1,
				textAline: "center"
			}, n.panel.on("click", ".btn-primary", function(e) {
				n.hide(!0)
			}), n.panel.on("click", ".btn-default", function(e) {
				e.preventDefault(), n.hide()
			})
		};
	TipPanel.prototype = {
		delay: void 0,
		count: 0,
		setOptions: function(e) {
			var t = this;
			for(i in e) t.options[i] = e[i];
			t.options.showTitle ? t.panelTitle.show() : t.panelTitle.hide(), t.options.showTips ? t.panelTips.show() : t.panelTips.hide(), t.options.panelInput ? t.panelInput.show() : t.panelInput.hide(), t.options.okText && t.btnOk.text(t.options.okText), t.options.cancelText && t.btnCancel.text(t.options.cancelText), t.options.tipsText && t.panelTips.html(t.options.tipsText), t.options.titleText && t.panelTitle.text(t.options.titleText), "confirm" == t.options.type ? (t.btnOk.show(), t.btnCancel.show()) : "prompt" == t.options.type ? (t.btnOk.show(), t.btnCancel.show()) : (t.btnOk.show(), t.btnCancel.hide()), t.options.className ? t.panelText.addClass(t.options.className) : t.panelText.removeClass(t.options.className), t.panelText.html(t.options.message), t.panel.show(), t.panelBg.show(), t.dialogContent.height() > $(window).height() ? t.dialogContent.css({
				"margin-top": 0,
				top: 0
			}) : t.dialogContent.css({
				"margin-top": -(t.dialogContent.height() / 2),
				top: "50%"
			}), t.panelContent.css("max-height", $(window).height() - t.panelButtons.height()), t.options.tick > 1e3 ? (t.panelTick.text(t.options.tick / 1e3), t.delay = setInterval(function() {
				t.count < t.options.tick - 1e3 ? (t.count = count + 1e3, t.panelTick.text((t.options.tick - count) / 1e3)) : (t._end(), t.count = 0, clearInterval(t.delay))
			}, 1e3)) : t.options.tick <= 1e3 && t.options.tick > 0 && (t.delay = setTimeout(function() {
				t._end()
			}, t.options.tick))
		},
		_end: function() {
			var e = this;
			e.panel.hide(), e.panelBg.hide(), "function" == typeof e.options.tipsCallback ? (e.options.tipsCallback(), e.options.tipsCallback = void 0) : "function" == typeof e.options.yesCallback && (e.options.yesCallback(), e.options.yesCallback = void 0)
		},
		show: function() {},
		hide: function(e) {
			var t = this;
			t.delay && clearTimeout(t.delay), t.panel && (t.panel.hide(), t.panelBg.hide(), e ? "function" == typeof t.options.yesCallback && t.options.yesCallback() : "function" == typeof t.options.noCallback && t.options.noCallback(), t.options.yesCallback = void 0, t.options.noCallback = void 0)
		},
		preventDefault: function(e) {
			e.preventDefault()
		}
	};
	var Tools = {
		absImg: function(e, t) {
			if(!e) switch(t) {
				case 1:
					return config.WHITE_IMG_URL;
				default:
					return t || config.DEF_IMG_URL
			}
			return "object" == typeof e && e.length > 0 && (e = e[0]), e && 0 == e.indexOf("http://") ? e : config.HOST_IMAGE + e
		},
		formatDate: function(e, t, n) {
			if(0 == e) return "--";
			var o = t || "yyyy-MM-dd hh:mm";
			if(isNaN(e) || null == e) return n || e;
			if("object" == typeof e) {
				var a = dd.getFullYear(),
					i = dd.getMonth() + 1,
					r = dd.getDate();
				i < 10 && (i = "0" + i);
				var s = a + "-" + i + "-" + r,
					c = s.match(/(\d+)/g),
					l = new Date(c[0], c[1] - 1, c[2]);
				return format(l, o)
			}
			"string" == typeof e && (e = 1 * e), e < 9999999999 && (e = 1e3 * e);
			var l = new Date(parseInt(e));
			return format(l, o)
		},
		formatCurrency: function(e, t, n) {
			if(!e) return t || "--";
			e += "";
			var o, a, i = e.indexOf(".");
			i > 0 ? (o = e.substring(0, i), a = e.substring(i, e.length)) : (o = e, a = "");
			var r = o.toString().length % 3,
				s = "";
			return 1 == r ? s = "00" : 2 == r && (s = "0"), o = s + o, o = o.replace(/(\d{3})/g, "$1,"), o = o.substring(0, o.length - 1), s.length > 0 && (o = o.replace(s, "")), a && (2 == a.length ? a += "0" : 1 == a.length && (a += "00"), a = a.substring(0, 3)), o + a
		},
		strToDate: function(e) {
			var t = e.split(" "),
				n = t[0].split("-"),
				o = parseInt(n[0], 10),
				a = parseInt(n[1], 10) - 1,
				i = parseInt(n[2], 10),
				r = t[1].split(":"),
				s = parseInt(r[0], 10),
				c = parseInt(r[1], 10) - 1,
				l = parseInt(r[2], 10),
				d = new Date(o, a, i, s, c, l);
			return d
		},
		getRunTime: function(e, t, n) {
			if(!e || isNaN(e) || !t || isNaN(t) || !n || isNaN(n)) return "数据错误";
			var o;
			if(o = n > e ? parseInt(n) - parseInt(e) : parseInt(t) - parseInt(e), o <= 0) return "已结束";
			var a = Math.floor(o / 86400),
				i = Math.floor(o / 3600) % 24,
				r = Math.floor(o / 60) % 60,
				s = Math.floor(o) % 60;
			return n > e ? "距开始还有" + Tools.checkTime(a) + "天<small>" + Tools.checkTime(i) + "</small>:<small>" + Tools.checkTime(r) + "</small>:<small>" + Tools.checkTime(s) + "</small>" : "距结束还有" + Tools.checkTime(a) + "天<small>" + Tools.checkTime(i) + "</small>:<small>" + Tools.checkTime(r) + "</small>:<small>" + Tools.checkTime(s) + "</small>"
		},
		checkTime: function(e) {
			return e < 10 && (e = "0" + e), e
		},
		getQueryValue: function(e) {
			var t = location.search,
				n = new Array;
			if(t.length > 1) {
				var o = t.indexOf("?");
				t = t.substring(o + 1, t.length)
			} else t = null;
			if(t)
				for(var a = 0; a < t.split("&").length; a++) n[a] = t.split("&")[a];
			for(var i = 0; i < n.length; i++)
				if(n[i].split("=")[0] == e) return decodeURI(n[i].split("=")[1]);
			return ""
		},
		getWindow: function() {
			return {
				width: window.innerWidth,
				height: window.innerHeight
			}
		},
		getNoScrollWin: function() {
			return {
				width: $(window).width(),
				height: $(window).height()
			}
		},
		getDocument: function() {
			var e = document.documentElement || document.body;
			return {
				width: e.clientWidth,
				height: e.clientHeight
			}
		},
		getScreen: function() {
			return {
				width: screen.width,
				height: screen.height
			}
		},
		showOrHideScrollBar: function(e) {
			preventDefault = preventDefault || function(e) {
				e.preventDefault()
			}, (document.documentElement || document.body).style.overflow = e ? "auto" : "hidden", e ? document.removeEventListener("touchmove", preventDefault, !1) : document.addEventListener("touchmove", preventDefault, !1)
		},
		showDialog: function() {},
		showOverlay: function() {},
		showConfirm: function(e, t, n) {
			var o = {};
			"object" == typeof e ? o = e : (o.message = e, o.yesCallback = t, o.noCallback = n), o.type = "confirm", o.showTitle = !0, o.showTip = !1, o.titleText = o.titleText || "提示", o.className = o.className || "text-c", panel = panel || new TipPanel, panel.setOptions(o)
		},
		showAlert: function(e, t, n) {
			var o = {};
			"object" == typeof e ? o = e : (o.message = e, o.tick = t, o.yesCallback = n), "boolean" != typeof o.showTitle && (o.showTitle = !1), o.type = "alert", panel = panel || new TipPanel, panel.setOptions(o)
		},
		showPrompt: function(e, t, n, o, a) {
			var i = {};
			"object" == typeof e ? i = e : (i.message = e, i.tick = o, i.okText = n || "确定", i.yesCallback = a), "boolean" != typeof i.showTitle && (i.showTitle = !1), i.showTitle = !0, i.showTip = !1, i.titleText = t || "提示", i.type = "prompt", panel = panel || new TipPanel, panel.setOptions(i)
		},
		showPromptInput: function(e, t, n, o, a) {
			var i = {};
			"object" == typeof e ? i = e : (i.message = e, i.tick = o, i.okText = n || "确定", i.yesCallback = a), "boolean" != typeof i.showTitle && (i.showTitle = !1), i.showTitle = !0, i.panelInput = !0, i.showTip = !1, i.titleText = t || "提示", i.type = "prompt", panel = panel || new TipPanel, panel.setOptions(i)
		},
		showLoading: function() {
			$("#fruitday-loading").show()
		},
		hideLoading: function() {
			$("#fruitday-loading").hide()
		},
		hidePanel: function(e) {
			panel && panel.hide(e)
		},
		showToast: function(e, t) {
			toastPanel = toastPanel || $("#fruitday-toast"), t = t || 4e3, delay && clearTimeout(delay), toastPanel.find("span").html(e), toastPanel.show(), delay = setTimeout(function() {
				toastPanel.hide()
			}, t)
		},
		isIPad: function() {
			return /iPad/gi.test(navigator.appVersion)
		},
		isIos: function() {
			return /iphone|iPad/gi.test(navigator.appVersion)
		},
		isAndroid: function() {
			return /android/gi.test(navigator.appVersion)
		},
		isWeChatBrowser: function() {
			var e = navigator.userAgent.toLowerCase();
			return "micromessenger" == e.match(/MicroMessenger/i)
		},
		isFruitdayAppBrowser: function() {
			var e = navigator.userAgent;
			return "FD_iPhone" == e.match(/FD_iPhone/i) || "FD_Android" == e.match(/FD_Android/i)
		},
		isFruitdayAndroidBrowser: function() {
			var e = navigator.userAgent;
			return "FD_Android" == e.match(/FD_Android/i)
		},
		isFruitdayiOSBrowser: function() {
			var e = navigator.userAgent;
			return "FD_iPhone" == e.match(/FD_iPhone/i)
		},
		isAliPayBrowser: function() {
			var e = navigator.userAgent.toLowerCase();
			return "alipayclient" == e.match(/AlipayClient/i)
		},
		formJson: function(e) {
			var t = {},
				n = $(e).serializeArray();
			return $.each(n, function() {
				void 0 !== t[this.name] ? (t[this.name].push || (t[this.name] = [t[this.name]]), t[this.name].push(this.value || "")) : t[this.name] = this.value || ""
			}), t
		},
		alert: function(e) {
			Cookie.get("DevDebug") ? alert(e) : console.log(e)
		},
		_GET: function() {
			var e = location.search,
				t = {};
			if("" === e || void 0 === e) return t;
			e = e.substr(1).split("&");
			for(var n in e) {
				var o = e[n].split("=");
				t[o[0]] = o[1]
			}
			return t.from && delete t.code, t
		},
		removeParamFromUrl: function(e) {
			var t = Tools._GET();
			for(var n in e) delete t[e[n]];
			return location.pathname + Tools.buildUrlParamString(t)
		},
		buildUrlParamString: function(e) {
			var t = "";
			for(var n in e) t += n + "=" + e[n] + "&";
			t = t.slice(0, t.length - 1);
			var o = "" === t || void 0 === t;
			return o ? "" : "?" + t
		},
		sliceCurrency: function(e, t) {
			if(!e || isNaN(e)) return e;
			e = parseFloat(e).toFixed(2) + "";
			var n, o, a = e.indexOf(".");
			return a > 0 ? (n = e.substring(0, a), o = e.substring(a, e.length), o.indexOf(".00") > -1 ? o = "" : "0" == o.substr(o.length - 1, o.length) && (o = "." == o.substr(0, o.length - 1) ? "" : o.substr(0, o.length - 1))) : (n = e, o = ""), "prefix" == t ? n : "subfix" == t ? o : n + o
		},
		changeURLArg: function(url, arg, arg_val) {
			var pattern = arg + "=([^&]*)",
				replaceText = arg + "=" + arg_val;
			if(url.match(pattern)) {
				var tmp = "/(" + arg + "=)([^&]*)/gi";
				return tmp = url.replace(eval(tmp), replaceText)
			}
			return url.match("[?]") ? url + "&" + replaceText : url + "?" + replaceText
		}
	};
	window.Tools = Tools
}(),
function() {
	var e = {
		toLogin: function() {
			Tools.isFruitdayAppBrowser() ? location = "fruitday://Login" : location.href = "../me/login.html"
		}
	};
	window.Go = e
}(),
function() {
	function e(e) {
		$(".cover-bg").fadeIn(), $("#pay-desk").slideDown(), m.on("click", "#opt-payway", function() {
			$(this).parents(".cashier-box").addClass("fadeOutLeft animated").one("webkitAnimationEnd animationend", function() {
				$(this).removeClass("fadeOutLeft animated").addClass("hide")
			}).siblings(".cashier-box").removeClass("hide").addClass("fadeInRight animated").one("webkitAnimationEnd animationend", function() {
				$(this).removeClass("fadeOutLeft animated")
			})
		}).on("click", ".back, .scroll>ul>li", function(t) {
			if(!$(t.currentTarget).hasClass("active") && !$(t.currentTarget).hasClass("back")) {
				$(this).addClass("active").siblings().removeClass("active");
				var n = $(this).data("pay_id"),
					o = $(this).data("pay_parent_id");
				a(n, o, e), $(".pay-button").hasClass("dis") && $(".pay-button").removeClass("dis")
			}
			$(this).parents(".cashier-box").addClass("fadeOutRight animated").one("webkitAnimationEnd animationend", function() {
				$(this).removeClass("fadeOutRight animated").addClass("hide")
			}).siblings(".cashier-box").removeClass("hide").addClass("fadeInLeft animated").one("webkitAnimationEnd animationend", function() {
				$(this).removeClass("fadeInLeft animated")
			})
		}).on("click", ".ellipse", function() {
			$(this).toggleClass("active"), $(this).hasClass("active") ? o(1, e) : o(0, e)
		}).on("click", ".pay-button:not(.dis)", function() {
			var e = $("#money").text(),
				t = $("#opt-payway").data("pay_id"),
				n = $("#opt-payway").data("pay_parent_id");
			e > 0 ? $("#balance").length > 0 && $("#balance .ellipse").hasClass("active") ? h > 0 ? (console.log(111), r(e)) : c("", e) : i(e, t, n) : h > 0 ? r(e) : s("", e)
		})
	}

	function t() {
		$(".cover-bg").fadeOut(), $("#pay-desk").slideUp(), m.off("click", ".ellipse").off("click", ".back, .scroll>ul>li").off("click", "#opt-payway").off("click", ".pay-button")
	}

	function n(e) {
		var t = Cookie.get("connect_id");
		Ajax.custom({
			url: config.HOST_API + "v3/user/detail",
			data: {
				connect_id: t
			}
		}, function(e) {
			f = e.data.mobile
		}, function(e, t) {
			Tools.showToast(t.msg, 1500)
		}), Ajax.custom({
			url: config.HOST_API + "v3/pay/init",
			data: {
				connect_id: t,
				order_name: v,
				browser_type: g
			},
			showLoading: !0
		}, function(t) {
			h = t.data.need_send_code, y = t.data.use_money_deduction;
			for(var n, o = t.data.payments.online.pays, i = t.data.selectPayments.pay_name, r = 0, s = 0; s < o.length; s++)
				if(o[s].pay_name == i) {
					n = i, r = 1;
					break
				}
			if(!r) {
				n = o[0].pay_name;
				var c = o[0].pay_id,
					l = o[0].pay_parent_id;
				a(c, l, e)
			}
			n = n.replace("网上银行支付-", ""), Object.assign(t.data.selectPayments, {
				pay_name: n
			}), Ajax.render("#pay-desk", "pay-desk-tmpl", t.data)
		}, function(e, t) {
			return Tools.isWeChatBrowser() || 311 != t.code ? void Tools.showToast(t.msg, 1500) : void(location.href = config.HOST_API + "main/pay-success.html?order_name=" + v)
		})
	}

	function o(e, t) {
		var n = Cookie.get("connect_id");
		Ajax.custom({
			url: config.HOST_API + "v3/pay/balance_deduction",
			data: {
				connect_id: n,
				order_name: v,
				use_flag: e,
				browser_type: g
			},
			showLoading: !0
		}, function(e) {
			h = e.data.need_send_code, y = e.data.use_money_deduction;
			var n = e.data.selectPayments.pay_name;
			n = n.replace("网上银行支付-", ""), Object.assign(e.data.selectPayments, {
				pay_name: n
			}), Ajax.render("#balancePay", "balancePay-tmpl", e.data), e.data.selectPayments.pay_parent_id > 0 ? $("#pay-desk").find(".pay-button").removeClass("dis") : ($("#pay-desk").find(".pay-button").addClass("dis"), $(".scroll>ul>li").removeClass("active")), t && t(e)
		}, function(e, t) {
			Tools.showToast(t.msg, 1500)
		})
	}

	function a(e, t, n) {
		var o = Cookie.get("connect_id");
		Ajax.custom({
			url: config.HOST_API + "v3/pay/switch_channel",
			data: {
				connect_id: o,
				order_name: v,
				pay_id: e,
				pay_parent_id: t,
				browser_type: g
			}
		}, function(e) {
			h = e.data.need_send_code;
			var t = e.data.selectPayments.pay_name;
			t = t.replace("网上银行支付-", ""), Object.assign(e.data.selectPayments, {
				pay_name: t
			}), Object.assign(e.data, {
				use_money_deduction: y
			}), Ajax.render("#thirdPay", "thirdPay-tmpl", e.data), n && n(e)
		}, function(e, t) {
			Tools.showToast(t.msg, 1500)
		})
	}

	function i(e, t, n) {
		var o = Cookie.get("connect_id");
		Ajax.custom({
			url: config.HOST_API + "v3/pay/gateway_url",
			data: {
				connect_id: o,
				order_name: v,
				need_online_pay: e,
				pay_id: t,
				pay_parent_id: n,
				browser_type: g
			},
			showLoading: !0
		}, function(e) {
			location.href = e.data
		}, function(e, t) {
			Tools.showToast(t.msg, 1500)
		})
	}

	function r(e) {
		var t = Cookie.get("connect_id"),
			n = /^(\d{3})\d{4}(\d{4})$/,
			o = f.replace(n, "$1****$2");
		Ajax.custom({
			url: config.HOST_API + "v3/pay/send_vercode",
			data: {
				connect_id: t,
				mobile: f,
				browser_type: g
			},
			showLoading: !0
		}, function(t) {
			$(".panel-input>input").val(" "), Tools.showPromptInput("验证码已发送至手机<br/>" + o, "", "支付", "", function() {
				var t = $(".panel-input>input").val();
				e > 0 ? c(t, e) : s(t, e)
			})
		}, function(e, t) {
			Tools.showToast(t.msg, 1500)
		})
	}

	function s(e, t) {
		var n = Cookie.get("connect_id"),
			o = t,
			a = $("#total").text();
		"" == e && (f = ""), Ajax.custom({
			url: config.HOST_API + "v3/pay/balance_pay",
			data: {
				connect_id: n,
				order_name: v,
				need_online_pay: o,
				money: a,
				mobile: f,
				ver_code: e,
				browser_type: g
			},
			showLoading: !0
		}, function(e) {
			location.href = e.data
		}, function(e, t) {
			Tools.showToast(t.msg, 1500)
		})
	}

	function c(e, t) {
		var n = Cookie.get("connect_id"),
			o = t,
			a = $("#opt-payway").data("pay_id"),
			i = $("#opt-payway").data("pay_parent_id");
		"" == e && (f = ""), Ajax.custom({
			url: config.HOST_API + "v3/pay/mix",
			data: {
				connect_id: n,
				order_name: v,
				need_online_pay: o,
				pay_id: a,
				pay_parent_id: i,
				mobile: f,
				ver_code: e,
				browser_type: g
			},
			showLoading: !0
		}, function(e) {
			location.href = e.data
		}, function(e, t) {
			Tools.showToast(t.msg, 1500)
		})
	}

	function l(e) {
		var t = e.find(".icon-searchhomedel");
		$(document).on("click", ".search-box .navbar-header", function() {
			$(this).parents(".search-box").hide()
		}), e.on("input propertychange focus", ".searchbar>input", function() {
			var n = $(this).val(),
				o = $(window).height();
			w && clearTimeout(w), "" != n ? (t.show(), w = setTimeout(function() {
				Ajax.custom({
					type: "GET",
					url: config.HOST_API + "v3/search/keyword",
					data: {
						keyword: n
					},
					showLoading: !0
				}, function(t) {
					var n = t.data;
					Ajax.render("#searchTips", "searchTips-tmpl", n), e.find(".search-tips").slideDown("fast", function() {
						$(this).css("height", o - 53)
					})
				}, function(e, t) {
					Tools.showToast(t.msg)
				})
			}, 600)) : (t.hide(), e.find(".search-tips").slideUp("fast"), $("#keyWord").show().siblings("#categoryList").hide())
		}), e.on("click", ".clear-sign", function() {
			$(this).hide(), $(".history").hide().find("a").remove(), Cookie.remove("hstData"), T = []
		}).on("click", ".search-tips a", function() {
			e.find(".search-tips").slideUp("fast").end().find(".searchbar>input").val($(this).text())
		}).on("click", ".keyword a", function() {
			e.find("#searchInput").val($(this).text()), t.show()
		}), t.on("click", function() {
			e.find(".searchbar>input").val("").focus(), t.hide(), e.find(".search-tips").slideUp("fast"), $("#keyWord").show().siblings("#categoryList").hide()
		}), e.on("click", ".keyword a,#searchTips a", function() {
			var e = $(this).text();
			u.getProduct(!1, e)
		}).on("click", "#submit", function() {
			var e = $("#searchInput").val();
			u.getProduct(!0, e)
		}).on("keydown", ".searchbar>input", function() {
			if(13 == event.keyCode) {
				var e = $("#searchInput").val();
				u.getProduct(!0, e)
			}
		}), e.on("click", ".category-list a .count", function(e) {
			e.preventDefault();
			var t = $(this).parents(".item").attr("data-id");
			u.addCart({
				product_id: t
			})
		})
	}

	function d(e) {
		var t = !0;
		if(e && (e = e.replace(/(^\s*)|(\s*$)/g, "")), "" != T) {
			for(var n = 0; n < T.length; n++)
				if(e == T[n]) {
					t = !1;
					break
				}
			if(!t) return "";
			T = T.concat(e), Ajax.render("#hstWord", "hstWord-tmpl", T), Cookie.set("hstData", T, 10)
		} else T = T.concat(e), Ajax.render("#hstWord", "hstWord-tmpl", T), Cookie.set("hstData", T, 10)
	}
	var u = {};
	u.checkLoginStatus = function(e) {
		if(!Tools.isFruitdayAppBrowser()) {
			var t = Cookie.get("connect_id");
			t ? e && e() : location.href = "../me/login.html"
		}
	};
	var p = !1;
	u.initCountDown = function(e, t) {
		if(!p) {
			p = !0;
			var n = 0,
				e = parseInt(e);
			setInterval(function() {
				$(t).each(function(t, o) {
					var a = $(this).attr("data-end");
					$(this).text(Tools.getRunTime(e + n, a))
				}), n++
			}, 1e3)
		}
	}, u.lazyload = function(e) {
		function t() {
			$(e).each(function(e, t) {
				if(!$(this).hasClass("loaded") && "" != $(this).attr("data-src")) {
					var t = $(this).offset(),
						a = $(this).height() + 8;
					t.top + a >= o && t.top < o + 5 * n && $(this).attr("src", $(this).attr("data-src")).addClass("loaded")
				}
			})
		}
		var n = ($(document).height(), $(window).height()),
			o = 0;
		$(window).scroll(function() {
			o = $(window).scrollTop(), t()
		}), setTimeout(t, 200)
	}, $(document).on("click", ".nextpage", function(e) {
		$(this).hasClass("disabled") || (config.PAGE++, u.getList && u.getList())
	}), $(window).scroll(function() {
		if(0 != $(".nextpage").length && !$(".nextpage").hasClass("disabled")) {
			var e = $(window).scrollTop(),
				t = $(window).height(),
				n = $(".nextpage").offset();
			n.top < e + 3 * t / 2 && (config.PAGE++, u.getList && u.getList())
		}
	}), document.getElementById("fruitday-cover-bg") && document.getElementById("fruitday-cover-bg").addEventListener("touchmove", function(e) {
		e.preventDefault()
	}, !0), $(".back-top").click(function(e) {
		e.preventDefault(), window.scrollTo(0, 0)
	}), u.abcLogin = function(e, t) {
		Storage.get("connect_id");
		Ajax.custom({
			url: "http://stagingnirvana2.fruitday.com/api/test?service=user.signin",
			data: {
				mobile: e || "18149715819",
				password: t || "123456"
			}
		}, function(e) {
			console.log(e)
		}, function(e, t) {
			Storage.set("connect_id", t.connect_id)
		})
	}, u.pullToRefresh = function(e, t) {
		Tools.isFruitdayAndroidBrowser() ? void 0 == t ? location.href = "fruitday://PullToRefresh?close=" + e : location.href = "fruitday://PullToRefresh?close=" + e + "&url=" + encodeURIComponent(t) : void 0 != t && (location.href = t)
	}, u.addCart = function(e, t) {
		var n = Cookie.get("connect_id"),
			o = Storage.get("store_id_list");
		if("" == n || void 0 == n) return void Tools.showConfirm("您还没有登录了，请先登录!", function() {
			location.href = "../me/login.html"
		});
		var a = e.product_id,
			i = e.type,
			r = e.pmt_id,
			s = e.send_id,
			c = e.active_type;
		user_gift_id = e.id, Ajax.custom({
			url: config.HOST_API + "v3/cart/add",
			data: {
				connect_id: n,
				store_id_list: o,
				product_id: a,
				type: i || "normal",
				pmt_id: r,
				gift_send_id: s,
				gift_active_type: c,
				user_gift_id: user_gift_id
			},
			showLoading: !0
		}, function(e) {
			Tongji.addCart();
			var n = $("#cart-num");
			n.length && $("#cart-num").text(e.cart.count).show(), t && t(e), Tools.showToast(e.msg, 1500)
		}, function(e, t) {
			console.log(e), Tools.showToast(t.msg, 1500)
		})
	}, u.countCartNum = function() {
		var e = Cookie.get("connect_id") || !1,
			t = Storage.get("store_id_list") || !1;
		e && t && Ajax.custom({
			url: config.HOST_API + "/v3/cart/count",
			data: {
				connect_id: e,
				store_id_list: t
			},
			showLoading: !1
		}, function(e) {
			var t = e.count,
				n = $("#cart-num");
			n.length && (t ? n.text(t).show() : n.text(t).hide())
		}, function(e, t) {
			Tools.showToast(t.msg || "统计购物车错误!")
		})
	}, "FastClick" in window && FastClick.attach(document.body), Tools.isFruitdayAppBrowser() && ($(".back .icon-morehome").hide().click(function(e) {
		e.preventDefault()
	}), $(".back .icon-searchhomedel").show(), $(".icon-dianhua-copy").parent("a").attr("href", "fruitday://ContactService")), Tools.isFruitdayiOSBrowser() && $("body").addClass("has-app");
	var h, f, g, m = {},
		y = "",
		v = "";
	u.payDesk = function(o, a) {
		v = o, $("#checkOut").length && $("#checkOut").remove(), g = Tools.isWeChatBrowser() ? "wechat" : Tools.isAliPayBrowser() ? "alipay" : "";
		var i = "../content/html/paydesk.html";
		$.ajax({
			url: i,
			async: !1
		}).done(function(t) {
			$("body").append(t), m = $("#pay-desk"), e(a), n(a)
		}), m.on("click", ".cancel", t)
	};
	var w, _ = {},
		T = Cookie.get("hstData") || [],
		b = Storage.get("store_id_list") || "",
		S = Storage.get("tms_region_type") || "";
	u.gdSearch = function(e) {
		if(_.length && _.length > 0) _.show(), e && e();
		else {
			var t = location.protocol + "//" + location.host + "/content/html/main/goods-search.html";
			$.ajax({
				url: t
			}).done(function(t) {
				$("body").append(t), _ = $("#goods-search"), Ajax.custom({
					type: "GET",
					url: config.HOST_API + "v3/search/get_hot_keyword",
					data: {},
					showLoading: !0
				}, function(e) {
					var t = e.data;
					Ajax.render("#hotWord", "hotWord-tmpl", t)
				}), "" != T && (T = T.split(","), Ajax.render("#hstWord", "hstWord-tmpl", T)), l(_), e && e()
			})
		}
	}, u.getProduct = function(e, t) {
		$("#fruitday-list");
		Ajax.custom({
			type: "GET",
			url: config.HOST_API + "v3/search/product",
			data: {
				keyword: t,
				store_id_list: b,
				tms_region_type: S,
				page_size: 50,
				curr_page: config.PAGE
			},
			key: "data",
			showLoading: !0
		}, function(n) {
			Ajax.render("#fruitday-list", "fruitday-list-tmpl", n.data), $(".category-list").show().siblings("#keyWord").hide(), e && $("#searchTips").hide(), d(t)
		}, function(e, t) {
			Tools.showToast(t.msg || "无法连接服务器")
		})
	}, u.getLocation = function(e) {
		if(Storage.get("store_id_list") && Storage.get("delivery_code") && Storage.get("tms_region_type")) e && e();
		else {
			var t, n, o, a, i, r, s, c;
			t = new AMap.Map("", {}), t.plugin(["AMap.Geolocation", "AMap.Geocoder"], function() {
				n = new AMap.Geolocation({
					noGeoLocation: config.NO_GEO_LOCATION,
					enableHighAccuracy: !0,
					timeout: 1e4,
					buttonOffset: new AMap.Pixel(10, 20),
					zoomToAccuracy: !1
				}), o = new AMap.Geocoder({
					timeout: 1e4
				}), n.getCurrentPosition(), AMap.event.addListener(n, "complete", function(t) {
					var n = t.addressComponent;
					r = n.building || n.township, s = t.formattedAddress, c = {
						detail_addr: s,
						province_name: n.province,
						area_name: n.district
					}, a = t.position.getLng() + "," + t.position.getLat(), i = n.adcode, Ajax.custom({
						type: "GET",
						url: config.HOST_API + "v3/tms_store/lists_by_lonlat",
						data: {
							lonlat: a,
							area_adcode: i
						}
					}, function(t) {
						var n = t.data;
						Storage.set("addAress", c), Storage.set("area_adcode", i), Storage.set("lonlat", a), Storage.set("current_addr", r), Storage.set("store_id_list", n.store_id_list), Storage.set("tms_region_time", n.tms_region_time), Storage.set("tms_region_type", n.tms_region_type), Storage.set("delivery_code", n.delivery_code), e && e()
					}, function(e, t) {
						$("body").html('<div class="nodata">' + (t && t.message || "服务器异常。" + e) + "</div>")
					})
				}), AMap.event.addListener(n, "error", function(e) {
					$("body").html('<div class="nodata">' + e.message + "</div>")
				})
			})
		}
	}, window.common = u
}(),
function() {
	function e(e) {
		var a, i = e.find(".icon-searchhomedel"),
			r = e.find(".search-more"),
			s = $("#addrSearch").val(),
			l = e.find(".search-more em").text();
		n(), e.on("input propertychange", ".searchbar>input", function() {
			s = $(this).val(), l = e.find(".search-more em").text(), o.hideRegion(r, e), c = 1, a && clearTimeout(a), "" != s ? (i.show(), a = setTimeout(function() {
				t(l, s)
			}, 300)) : (i.hide(), n())
		}), e.on("focus", ".searchbar>input", function() {
			o.hideRegion(r, e), c = 1, e.find(".search-tips").show()
		}), e.on("click", "#addrBtn", function() {
			t(l, s)
		}).on("keydown", ".searchbar>input", function() {
			13 == event.keyCode && t(l, s)
		}), e.on("click", ".region-ul .more a", function() {
			o.openCity($(this))
		}), e.on("click", ".search-more span", function() {
			var t = $(this);
			c ? (o.showRegion(t, e, "schRge"), e.find(".search-tips").hide(), c = 0) : (o.hideRegion(t, e), e.find(".search-tips").show(), c = 1)
		}), e.on("click", '.region-ul>li:not(".more")>a,.list>li>a,.child>li>a', function() {
			o.choiceCity($(this), e), n(), c = 1
		}), i.on("click", function() {
			e.find("#addrSearch").val("").focus(), s = "", i.hide(), n()
		}), e.on("click", ".navbar-header", function() {
			e.hide()
		})
	}

	function t(e, t) {
		return t ? ($("#fruitday-loading").show(), void AMap.service("AMap.Autocomplete", function() {
			var n = new AMap.Autocomplete({
				city: e,
				citylimit: !0
			});
			n.search(t, function(e, t) {
				if(a.find(".before-search").hide(), "complete" === e && "OK" === t.info) {
					var n = t.tips;
					o.addrSchlt = n, Ajax.render("#addrList", "addrList-tmpl", n), a.find(".search-tips").show().end().find(".search-null").find("img").hide().end().show()
				} else "no_data" === e && a.find(".search-tips").empty().hide().end().find(".search-null").find("img").css({
					display: "inline-block"
				}).end().show();
				$("#fruitday-loading").hide()
			})
		})) : ""
	}

	function n() {
		i = Storage.get("hstAddr") || [], i.length && i.length > 0 ? (o.addrSchlt = i, Ajax.render("#addrList", "addrList-tmpl", i), a.find(".search-null").hide().end().find(".search-tips").show()) : a.find("#addrList").empty().end().find(".search-null").hide().end().find(".before-search").show()
	}
	var o = {
			addrSchlt: {}
		},
		a = {},
		i = Storage.get("hstAddr") || [],
		r = $(".modal .curr").outerHeight(!0) || 87,
		s = $(window).height();
	o.addrSearch = function() {
		if(a.length && a.length > 0) a.show(0, function() {
			return $("#addrSearch").val() ? "" : void n()
		});
		else {
			var t = location.protocol + "//" + location.host + "/content/html/main/address-search.html";
			$.ajax({
				url: t
			}).done(function(t) {
				$("body").append(t), a = $("#address-search"), o.getCurrRgn(a), e(a)
			})
		}
	};
	var c = 1,
		l = $(".m-region");
	o.showRegion = function(e, t, n) {
		if(t.find(l).length && t.find(l).length > 0) t.find(l).show().siblings("section").hide();
		else {
			var a = location.protocol + "//" + location.host + "/content/html/main/region.html";
			$.ajax({
				url: a
			}).done(function(e) {
				var a = Storage.get("currRegion");
				t.append(e), t.children(".m-region").find(".scroll").attr("id", n), l = $(".m-region"), t.find(l).show().siblings("section").hide(), $(".curr_region_name").text(a), Ajax.custom({
					type: "GET",
					url: config.HOST_API + "/v3/region/site_list",
					data: {},
					showLoading: !0
				}, function(e) {
					var a = e.data;
					Ajax.render("#" + n, "regionList-tmpl", a), currRheight = $(".m-region>.curr").outerHeight(!0), o.changeHeight(t, "#" + n)
				})
			})
		}
		e.find("i").addClass("rotate")
	}, o.hideRegion = function(e, t) {
		t.find(l).hide().siblings("section").show(0, function() {
			o.changeHeight(t, "#m-address .scroll")
		}), e.find("i").removeClass("rotate")
	}, o.choiceCity = function(e, t) {
		var n = e.text();
		t.find(l).hide().siblings("section").show().end().end().find(".search-more").find("i").removeClass("rotate"), a.length && a.length > 0 && a.find("#addrSearch").val("").end().find(".icon-searchhomedel").hide(), $(".show-nav").find("em").text(n), Storage.set("chooRegion", e.text())
	}, o.openCity = function(e) {
		"block" == e.siblings(".child").css("display") ? e.parent().removeClass("in") : e.parent().addClass("in").siblings().removeClass("in"), e.siblings("ul.child").slideToggle(), e.parent().siblings().children("ul.child").slideUp()
	}, o.changeHeight = function(e, t) {
		var n = e.find(".show-nav").outerHeight(!0);
		$(t).height(s - (n + r))
	}, o.getCurrRgn = function(e) {
		var t = Storage.get("chooRegion");
		e.find(".search-more em").text(t)
	}, o.setHistory = function(e) {
		var t = !0;
		if(i = Storage.get("hstAddr") || [], i.length > 9 && i.splice(0, 1), i) {
			for(var n = 0; n < i.length; n++)
				if(i[n].id == o.addrSchlt[e].id) {
					t = !1;
					break
				}
			return t ? (i = i.concat(o.addrSchlt[e]), Storage.set("hstAddr", i), "") : ""
		}
		i = i.concat(o.addrSchlt[e]), Storage.set("hstAddr", i)
	}, window.main = o
}(),
function() {
	Storage.get("config", 1) || config.HOST_API.indexOf("m.fruitday.com") != -1 || Ajax.custom({
		url: config.HOST_API + "v3/user/config"
	}, function(e) {
		200 == e.code && Storage.set("config", e.data, 1)
	}, function(e, t) {
		Tools.showToast(t.msg || "获取配置信息失败")
	});
	! function() {
		var e = document.createElement("script");
		e.src = "https://hm.baidu.com/hm.js?92f67a7d9df56c9a1d78418cf494238e";
		var t = document.getElementsByTagName("script")[0];
		t.parentNode.insertBefore(e, t)
	}()
}();
var returnCitySN;
(Storage.get("userIp", 1) || returnCitySN) && (returnCitySN && Storage.set("userIp", returnCitySN.cip, 1), dataLayer = [{
	UserIp: returnCitySN ? returnCitySN.cip : Storage.get("userIp", 1) || "",
	UserAgent: navigator.userAgent
}]),
function(e, t, n, o, a) {
	e[o] = e[o] || [], e[o].push({
		"gtm.start": (new Date).getTime(),
		event: "gtm.js"
	});
	var i = t.getElementsByTagName(n)[0],
		r = t.createElement(n),
		s = "dataLayer" != o ? "&l=" + o : "";
	r.async = !0, r.src = "https://www.googletagmanager.com/gtm.js?id=" + a + s, i.parentNode.insertBefore(r, i)
}(window, document, "script", "dataLayer", "GTM-5FVBQ88"),
function() {
	var e = {
		params: {
			pc: (new Date).getTime(),
			url: location.href,
			referrer: document.referrer,
			sn: "280803138f27de826c0cb1208c4aa960"
		},
		common: function(e) {
			e && Object.assign(this.params, e);
			var t = "";
			for(var n in this.params) "" != t && (t += "&"), t += n + "=" + encodeURIComponent(this.params[n]);
			var o = new Image(1, 1),
				a = "_img_" + Math.random();
			window[a] = o, o.onload = o.onerror = function() {
				window[a] = null, o.onload = null, o = null
			}, o.src = "https://statistics.fruitday.com/api/wap?" + t
		},
		all: function() {
			this.common()
		},
		register: function() {
			this.common({
				type: 4
			})
		},
		addCart: function() {
			this.common({
				type: 3
			})
		},
		submitOrder: function(e, t) {
			this.common({
				type: 1,
				order_name: e,
				om: t
			})
		},
		pay: function(e, t) {
			this.common({
				type: 2,
				order_name: e,
				om: t
			})
		}
	};
	e.all(), window.Tongji = e
}();